package storage


import (
	k8sclient "k8s_gui_client/k8s/client"
)

//PersistentVolumeClaim list
func GetPersistentVolumeClaims(namespace string) (map[string]interface{}, error) {

	if namespace != "" {
		return k8sclient.CurrentK8sApiClient.GetAPI("/api/v1/namespaces/" + namespace + "/persistentvolumeclaims")
	} else {
		return k8sclient.CurrentK8sApiClient.GetAPI("/api/v1/persistentvolumeclaims")

	}

}

func PersistentVolumeClaimURL(namespace string, name string) string {
	return "/api/v1/namespaces/" + namespace + "/persistentvolumeclaims/" + name
}


func GetPersistentVolumeClaimYaml(namespace string,name string) (string ,error){
    return k8sclient.CurrentK8sApiClient.GetAPIAsYaml(PersistentVolumeClaimURL(namespace,name))
}
func GetPersistentVolumeClaimStatus(namespace string,name string) (string ,error){
    return k8sclient.CurrentK8sApiClient.GetAPIAsYaml(PersistentVolumeClaimURL(namespace,name)+"/status")
}